package com.my.filter;

import java.io.File;
import java.io.FilenameFilter;
import java.util.Arrays;

/**
 * @author: marshal
 * @date: 2021-09-27 8:41 PM
 */
public class FilenameFilterDemo {
    public static void main(String[] args) {
       var file = new File("file");
        String[] list = file.list((dir, name) -> name.endsWith(".json") || new File(name).isDirectory());
        System.out.println(Arrays.toString(list));
    }
}
